package com.b2bpsssm.controller.material.store;

import com.b2bpsssm.common.R;
import com.b2bpsssm.pojo.Store;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "门店页面",tags = "门店接口Api")
public class StoreController {


//    @RequestMapping(value = "url路径",method = RequestMethod.GET)
//    @ApiOperation(value = "主标题",notes = "主标题描述",httpMethod = "get/post",response = R.class)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "page",value = "当前页码",required = true ),
//            @ApiImplicitParam(name = "limit",value = "每页条数",required = true )
//    })


    /*
    * 门店页页码每页条数查询
    * */
    @RequestMapping(value = "/Store/queryStoreByPageLimit",method = RequestMethod.GET)
    @ApiOperation(value = "查询门店",notes = "依靠当前页码和每页条数进行查询",httpMethod = "",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "当前页码",required = true ),
            @ApiImplicitParam(name = "limit",value = "每页条数",required = true )
    })
    @ResponseBody
    public R queryStoreByPageLimit(Integer page, Integer limit){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }


    /*
    * 新增门店
    * */
    @RequestMapping(value = "/Store/addStore",method = RequestMethod.POST)
    @ApiOperation(value = "新增门店",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sto_Create_Date",value = "创建时间",required = true ),
            @ApiImplicitParam(name = "sto_Id",value = "门店编号",required = true ),
            @ApiImplicitParam(name = "sto_Name",value = "门店名称",required = true ),
            @ApiImplicitParam(name = "sto_Con_Id",value = "门店等级",required = true ),
            @ApiImplicitParam(name = "sto_Tel",value = "标签",required = true ),
            @ApiImplicitParam(name = "sto_Email",value = "联系人编号（关联联系人）",required = true ),
            @ApiImplicitParam(name = "sto_Postalcode",value = "状态（1：启用；2：冻结；3：删除）",required = true ),
            @ApiImplicitParam(name = "sto_Status",value = "默认仓库(关联仓库)",required = true ),
            @ApiImplicitParam(name = "sto_Add",value = "门店分类（关联分类表）",required = true ),
            @ApiImplicitParam(name = "sto_Remark",value = "区域(关联区域表)",required = true ),
            @ApiImplicitParam(name = "sto_Qq",value = "详细地址",required = true ),
    })
    @ResponseBody
    public R addStore(Store Store){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 编辑门店
     * */
    @RequestMapping(value = "/Store/updateStore",method = RequestMethod.POST)
    @ApiOperation(value = "修改门店",notes = "保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sto_Create_Date",value = "创建时间",required = true ),
            @ApiImplicitParam(name = "sto_Id",value = "门店编号",required = true ),
            @ApiImplicitParam(name = "sto_Name",value = "门店名称",required = true ),
            @ApiImplicitParam(name = "sto_Con_Id",value = "门店等级",required = true ),
            @ApiImplicitParam(name = "sto_Tel",value = "标签",required = true ),
            @ApiImplicitParam(name = "sto_Email",value = "联系人编号（关联联系人）",required = true ),
            @ApiImplicitParam(name = "sto_Postalcode",value = "状态（1：启用；2：冻结；3：删除）",required = true ),
            @ApiImplicitParam(name = "sto_Status",value = "默认仓库(关联仓库)",required = true ),
            @ApiImplicitParam(name = "sto_Add",value = "门店分类（关联分类表）",required = true ),
            @ApiImplicitParam(name = "sto_Remark",value = "区域(关联区域表)",required = true ),
            @ApiImplicitParam(name = "sto_Qq",value = "详细地址",required = true ),
    })
    @ResponseBody
    public R updateStore(Store Store){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

//    /*
//     * 搜索门店
//     * */
//    @RequestMapping(value = "/Store/selStore",method = RequestMethod.GET)
//    @ApiOperation(value = "搜索门店",notes = "三个条件必选其一",httpMethod = "get",response = R.class)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "comClass",value = "门店分类",required = true ),
//            @ApiImplicitParam(name = "comCreateDate1",value = "创建时间1",required = true ),
//            @ApiImplicitParam(name = "comCreateDate2",value = "创建时间2",required = true ),
//            @ApiImplicitParam(name = "comNameKey",value = "关键字",required = true )
//    })
//    @ResponseBody
//    public R selStore(Store Store){
//        R r = new R();
//        r.setCode(200);
//        r.setData(666);
//        r.setMassage("success");
//        return r;
//    }


    /*
     * 删除门店
     * */
    @RequestMapping(value = "/Store/delStore",method = RequestMethod.POST)
    @ApiOperation(value = "删除门店",notes = "删除",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "stoId",value = "门店编码",required = true )
    })
    @ResponseBody
    public R delStore(String comId){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

}
